package algorithm.poj.p1000;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLDecoder;
import java.util.HashSet;
import java.util.Set;
import java.util.StringTokenizer;

/**
 * 分析：
 * 
 * 实现：
 * 
 * 经验：
 * 
 * 教训：
 * 
 * @author wong.tong@gmail.com
 *
 */
public class P1552 {

	@SuppressWarnings("unchecked")
	public static void main(String[] args) throws Exception {

		InputStream input = null;
		if (false) {
			input = System.in;
		} else {
			URL url = P1552.class.getResource("P1552.txt");
			File file = new File(URLDecoder.decode(url.getPath(), "UTF-8"));
			input = new FileInputStream(file);
		}
		
		BufferedReader stdin = new BufferedReader(new InputStreamReader(input));

		String line = stdin.readLine();
		while (line != null && !"-1".equals(line)) {
			StringTokenizer st = new StringTokenizer(line);
			Set<Integer> set = new HashSet<Integer>();
			while (st.hasMoreTokens()) {
				int a = Integer.valueOf(st.nextToken());
				if (a != 0) {
					set.add(a);
				}
			}
			int count = 0;
			for (int a: set) {
				if (set.contains(a*2)) {
					count ++;
				}
			}
			System.out.println(count);
			line = stdin.readLine();
		}
	}
}